#include "stdafx.h"
#include "Plant.h"
#include "Tools.h"


CPlant::CPlant()
	: m_Value(100)
	, m_Age(0)
	,m_BiologyId(0)
	,m_Hunger(100)
	,m_Hp(100)
	,m_Health(100)
	,m_IsClear(false)
	,m_EventId(0)
{
	
}


CPlant::~CPlant()
{
}

void CPlant::IsDied()
{
	if (m_Hp < 0)
	{
		m_IsClear = true;
	}
}

void CPlant::Consump(int hunger)
{
	m_Hunger -= hunger;
	if (m_Hunger < 0) m_Hunger = 0;
}

void CPlant::SetImage(IplImage * img)
{
	m_PlantImg = img;
}

void CPlant::Draw2Animal(IplImage * background)
{
	if (m_IsClear) return;
	CTools::Draw2Back(m_Pos.x, m_Pos.y, background, m_PlantImg, 245, 245, 245);
	//m_ImgId++;
}
